145

Advanced Graphics

145

11.3  THE USER INTERFACE

In order to drive the program with our choices, we come up with a design for the

interface. Something simple like below. It has the choice of Cumulative vs Current

(new) cases for selecting the top N. It also has the choice between cases and deaths.

The Go button starts executing the code after the user has entered the input.

FIGURE 11.7  User interface for COVID graph.

We can enter the states with their two-​character abbreviations with space separ­

ators like this:

We can use the same input field to enter the top N—​in the picture below N =​ 3:

Here is the first chart we want.

11.4  THE BAR CHART

FIGURE 11.8  COVID infection by state.